<template>
  <div id="login">
    <p class="iconfont icon-cuowu"></p>
    <h2>密码登录</h2>
    <div class="inputbox">
      <input type="text" placeholder="手机号/用户名" v-model="value.name" />
      <input type="password" placeholder="密码" v-model="value.pass" />
      <button @click="sendaxios()">登录</button>
    </div>
    <p><span>手机号登录</span><span>忘记密码</span></p>
    <p @click="goregister">去注册</p>
    <div class="xieyi">
      <input type="radio" />已阅读并同意<span
        >《用户服务协议》、《隐私政策》</span
      >
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: { name: "", pass: "" },
    };
  },
  methods: {
    // 发请求
    // sendaxios() {
    //   if (this.value.name && this.value.name) {
    //     login({ phone: this.value.name, pass: this.value.pass }).then(
    //     (res) => {
    //       // 登录成功
    //       if(res.data.status=='ok'){
    //         localStorage.setItem('token',res.data.token);
    //         // 保存用户信息
    //         localStorage.setItem('userinfo',JSON.stringify(res.data.userinfo));
    //         this.$router.push('/index')
    //       }
    //     }
    //   );
    //   } else {
    //     alert("账号/密码不能为空");
    //   }
      
    // },
    // goregister(){
    //   this.$router.push('/register')

    // }
  },
};
</script>

<style scoped>
.icon-cuowu {
  color: black;
  font-size: 30px;
}
h2 {
  margin-top: 80px;
  margin-left: 5%;
}
.inputbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}
.inputbox input {
  width: 90%;
  border: none;
  border-bottom: 1px solid gray;
  height: 35px;
  outline: none;
  box-sizing: border-box;
  color: gray;
  margin-top: 10px;
}
.inputbox button {
  width: 90%;
  height: 30px;
  line-height: 30px;
  outline: none;
  color: gray;
  background-color: rgb(215, 215, 215);
  border: none;
  border-radius: 15px;
  margin-top: 60px;
}
p {
  display: flex;
  justify-content: space-between;
  color: blue;
  margin-top: 10px;
  box-sizing: border-box;
  padding: 0 5%;
}
.xieyi {
  margin-top: 100px;
  color: gray;
  font-size: 12px;
  box-sizing: border-box;
  padding: 0 5%;
}
.xieyi span {
  color: blue;
}
</style>
